package com.foreknow.elmboot.mapper;

import com.foreknow.elmboot.po.Business;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Mapper:持久层交给Spring进行管理
 */
@Mapper
public interface BusinessMapper {
    /**
     * 根据分类的编号查询商家的信息
     * @param orderTypeId 分类的编号
     * @return List<Business>
     */
    @Select("select * from business where orderTypeId=#{orderTypeId} order by businessId")
    public List<Business> listBusinessByOrderTypeId(Integer orderTypeId);


    /**
     * 根据商家编号查询商家信息
     * @param businessId 对象
     * @return
     */
    @Select("select * from business where businessId=#{businessId}")
    public Business getBusinessById(Integer businessId);
}
